package models;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import play.data.validation.Required;
import play.db.jpa.Model;

@Entity
public class ContactoEmpresa extends Model {
	
	@ManyToOne
	public Organizacion contacto;
	
	public String cargo;
	
	public String area;
	
	@ManyToOne
	public Organizacion organizacion;
	
	@OneToMany
	public List<HistorialContactoCargo> historias;
	
	public void addHistoria(HistorialContactoCargo historia){
		if (historias == null)
			historias = new ArrayList<HistorialContactoCargo>();
		historias.add(historia);
	}
		
}
